using System;
using System.IO;
using NUnit.Framework;
using Rainbow.ObjectFlow.Engine;

namespace Objectflow.core.tests
{
    public class FunctionInvokerTests 
    {
        [Test]
        public void On_exception_should_rethrow()
        {
            
            var func = new Func<string, string>((s) => {throw new DirectoryNotFoundException();});
            var invoker = new FunctionInvoker<string>(func);

            Assert.Throws<DirectoryNotFoundException>(() => invoker.Execute("w"));
        }

    }
}